<?php

namespace app\common;

use app\model\VisitStatistic;
use think\Cookie;

/**
 * 统计访问量
 *
 * @author yyzh
 *        
 */
class BaseVisitController extends BaseController {
	public function _initialize() {
		parent::_initialize ();
		if (! Cookie::has ( 'VISIT_STATISTIC' )) {
			VisitStatistic::add ( $this->request->ip () );
			Cookie::set ( 'VISIT_STATISTIC', time () );
		}
	}
}